SUBDIRS = src doc

EXTRA_DIST = autogen.sh scrmgr.spec

.PHONY: rpm
rpm: dist
	cp @PACKAGE@-@VERSION@.tar.gz $$(rpm --eval %_topdir)/SOURCES
	rpmbuild -ba @PACKAGE@.spec

.PHONY: release
release:
	@[[ $$(svn status -q | wc -l) -eq 0 ]] || { \
	    echo "There is still something to check-in ..." >&2; \
	    svn status -q; \
	    exit 1; }
	@[[ ! -d "../tags/@PACKAGE@-@VERSION@" ]] || { \
	    echo "tag @PACKAGE@-@VERSION@ already exists" >&2; \
	    exit 1; }
	@echo "Just checking, but you _have_ updated the version numbers"
	@echo "in configure.ac?"
	@echo "Press <Enter> to continue or ^C to bail."
	@read

.PHONY: help
help:
	@echo "Available targets include:"
	@echo "all       : the normal make (default)"
	@echo "check     : runs tests (if any)"
	@echo "clean     : cleans the directory"
	@echo "install   : installs into the directories specified in 'configure'"
	@echo "uninstall : uninstalls from those same directories"
	@echo "distclean : cleans anything that configure created"
	@echo "release   : to tag the repository with the current version - consider"
	@echo "            incrementing the version in configure.ac first."
	@echo "rpm       : builds an RPM package"
